home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / httpd / Solaris_x86 / req_more_info.pl < prev    next >
Perl Script  |  1996-04-02  |  5KB  |  132 lines

  1. #!./perl
  2. #req_more_info.pl
  3.  
  4. # ------------------------------------------------------------
  5. # render dynamic page 
  6.  
  7. # parse disc name from ServerName Environt Variable with this script
  8.  
  9. do './variables.pl';
  10.  
  11.  
  12.     
  13.  
  14. # get args
  15.  
  16. while (@ARGV) {
  17. $ARGV=shift;
  18. $from = $ARGV;
  19. $ARGV=shift;
  20. $from_email = $ARGV;
  21. }
  22.  
  23.  
  24. # check to see if it is a fax, then make changes
  25.  
  26. if ($from_email !~ /[@!]/ ) {
  27.     $fax = "FAX this:$from_email";
  28.     $from_email = "marc.sacoolas\@sun.com";
  29.     }
  30.  
  31.  
  32. # see if info has already been filled out 
  33. # if so, skip form
  34.  
  35. if ( -e </tmp/httpd/info.*> ) { 
  36.  
  37. if ( -e "/tmp/httpd/info.email" ) { 
  38.  
  39.     open (FILE, ">>/tmp/httpd/info.email");
  40.     } else {
  41.     open (FILE, ">>/tmp/httpd/info.fax");
  42.     }
  43.  
  44.  
  45.     print FILE "$from\n"; 
  46. close (FILE);
  47.  
  48.     print "Content-type: text/html\n\n"; 
  49.     print "<html><head>\n";
  50.     print "<title>Information Request Acknowledgement</title>\n";
  51.     print "</head>\n<body>\n";
  52.     print "<applet code=delay.class width=596 height=75>";
  53.     print "<param name=img value=\"file:///tmp/httpd/.products/$disc_name/images/goto_home.gif\">";
  54.     print "<param name=del value=\"2200\">";
  55.     print "<param name=href value=\"file:///tmp/httpd/.products/$from/$disc_name.frame.html\"></applet>";
  56.     print "<p><p><center><hr>";
  57.     print "<p><h1>Your request for more information</h1>";
  58.     print "<h1>from this company has been made.</h1>";
  59.     print "<hr><H2>It will be E-mailed/Printed out when you end your $disc_name session.</h2></center>";
  60. #    &html_trailer;
  61.  
  62. exit 0;
  63. sub html_header {
  64.  
  65.     local($title) = @_;
  66.  
  67.     print "Content-type: text/html\n\n";
  68.     print "<html><head>\n";
  69.     print "<title>$title</title>\n";
  70.     print "</head>\n<body>\n";
  71. }
  72.  
  73. sub html_trailer {
  74.  
  75.     # subroutine html_trailer sends the trailing material to the HTML
  76.     # on STDOUT.
  77.  
  78.     local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
  79.     = gmtime;
  80.  
  81.     local($mname) = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
  82.              "Aug", "Sep", "Oct", "Nov", "Dec")[$mon];
  83.     local($dname) = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
  84.              "Sat")[$wday]; 
  85.  
  86.     print "<p>\nGenerated by: <var>$0</var><br>\n";
  87.     print "Date: $hour:$min:$sec UT on $dname $mday $mname $year.<p>\n";
  88.     print "</body></html>\n";
  89. }
  90.  
  91.  
  92.  
  93.  
  94.     &html_header('More Information Request Form');
  95.     print "<FORM METHOD=\"POST\" ACTION=\"http://localhost:7999/cgi-bin/more_info.pl\">\n";
  96.     #print "<FORM METHOD=\"POST\" ACTION=\"http://sun-www.ebay/cgi-bin/generic_mailer2.pl\">\n";
  97.     print "<INPUT NAME=\"mailto\" TYPE=\"hidden\" VALUE=\"$from_email\">\n";
  98.     print "<INPUT NAME=\"from\" TYPE=\"hidden\" VALUE=\"$from\">\n";
  99.     print "<INPUT NAME=\"request\" TYPE=\"hidden\" VALUE=\"$fax More information Request\">\n";
  100.     print "<INPUT NAME=\"thanks_url\" TYPE=\"hidden\" VALUE=\"http://localhost:7999/$disc_name/docs/thanks.html\">\n";
  101.     print "        Take a minute to fill out this form, and every subsequent request for more information will automatically use this.  If you do not have out going e-mail ability, please use the numbered card in the $disc_name case.\n";
  102.     print "<pre>"; 
  103.     print "<hr>"; 
  104.     print "<p>";
  105.     print "<B>Name    </B><input type=\"text\" size=20 name=\"REQUIRED Name\">";    
  106.     print "<B>    Title </B><input type=\"text\" size=21 name=\"REQUIREDTitle\">\n";    
  107.     print "<B>Company </B><input type=\"text\" size=20 name=\"REQUIRED Company\">\n";    
  108.     print "<B>Address </B><input type=\"text\" size=52 name=\"REQUIRED Adress\">\n";    
  109.     print "<B>City    </B><input type=\"text\" size=30 name=\"REQUIRED City\">\n";
  110.     print "<B>State   </B><input type=\"text\" size=11 name=\"REQUIRED State\">";
  111.     print "<B> Zip </B><input type=\"text\" size=8 name=\"REQUIRED Zip\">  ";
  112. #    print "<B>City, Zip, State </B><input type=\"text\" size=30 name=\"REQUIRED City,Zip,Sate\">";
  113.     print "<B>Country </B><input type=\"text\" size=16 name=\"Country\">\n";    
  114.     print "<B>E-mail Address           </B><input type=\"text\" size=35 name=\"Email\">\n";    
  115.     print "<B>Telephone Number         </B><input type=\"text\" size=20 name=\"Telephone\">\n";
  116.     print "<B>Fax                      </B><input type=\"text\" size=20 name=\"Fax\">";    
  117.     print "<p>";
  118.     print "<hr>";
  119.     print "<input type=\"checkbox\" name=\"release\" value=\"Please add\"><i>Please add my name to your mailing list.\n";
  120.     print "<p>";
  121.     print "<input type=\"checkbox\" name=\"add\" value=\"Please do not\"><i>Please do not release my name to other Sun-authorized organizations.\n";
  122.     print " <INPUT TYPE=\"radio\" NAME=\"submit\" VALUE=\"email\" checked> <B>E-mail Request</B> <INPUT TYPE=\"radio\" NAME=\"submit\" VALUE=\"fax\" > <B>Print Request for faxing</B>\n";
  123.     print "</pre>";
  124.     print "<hr>";
  125.     print "                  <INPUT TYPE=\"submit\" VALUE=\"Submit $disc_name Reply Card\">\n";
  126.     print '</form>'; 
  127.     &html_trailer;
  128.     exit 0;
  129.  
  130.  
  131.